package com.viego.financialrecommendsystem.controller;

import com.viego.financialrecommendsystem.common.AjaxResult;
import com.viego.financialrecommendsystem.entity.Focus;
import com.viego.financialrecommendsystem.entity.New;
import com.viego.financialrecommendsystem.service.INewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/new")
public class NewController {

    @Resource
    INewService newService;


    @GetMapping("/list")
    public AjaxResult list(){
        List<New> list = newService.list();
        return AjaxResult.success("查询成功",list);
    }


    @GetMapping("/focus")
    public AjaxResult focus(){
        List<Focus> list =newService.focus();
        return  AjaxResult.success("查询成功",list);
    }

}
